using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Sigecov.Models.Mapping
{
    public class PaisMap : EntityTypeConfiguration<Pais>
    {
        public PaisMap()
        {
            // Primary Key
            this.HasKey(t => t.paiId);

            // Properties
            this.Property(t => t.paiNome)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Paises");
            this.Property(t => t.paiId).HasColumnName("paiId");
            this.Property(t => t.paiNome).HasColumnName("paiNome");
        }
    }
}
